-
-
Notifications
You must be signed in to change notification settings - Fork 121
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat✨: allow to change and persist cookie before nuxt init #229
feat✨: allow to change and persist cookie before nuxt init #229
Conversation
will have a look when i get some time 👍 |
sorry been really overloaded with work atm, havent found time yet to look into it 😓 |
I checked a bit and played with it. I like where this is going and it makes working with stores in middleware possible, however, I'm not sure this is the final API we want, especially the |
I try to do the same thing inset the plugin like |
Ok so maybe we could just copy/paste the Then we merge and move forward to see how we can improve it. But at least people can try playing around with it. Maybe tag is as |
cannot agree more maybe, we can use the |
Ig it's fine using lodash-es in the Nuxt plugin, we'll see later what we can do. This issue has to be adressed so let's try things! I let you update the PR with whatever is needed from lodash to avoid changing the base plugin. So modifications only happen in the Nuxt package. :) |
I'm sorry I have no enough time to do it last week. maybe there's time in a few days. |
nw take your time ^_^ lodash are working on a v5 with native typescript, usm exports so could be a good start to see what we can do with it when they're done too. |
closing this as cookies are handled differently (and fully working hopefully with a nuxt context) in V4 |
Description
when opening a page on bowser, nuxt will be initialized and generate a html as response. if you are doing some thing like
useStore
and change store with nuxt's plugin, it will not persist state because there is no nuxt instance.so, I make a new nitro plugin to make sure the initialize connection can obtain data of cookies from client side, and set cookies after pinia store is changed.
but the problem that our plugin is not able to get nuxt instance is still unresolved, so I provided a method to tell the plugin what to pass.
Linked Issues
#221
Additional context
maybe we need to test how it work after many revision